#include <gtk/gtk.h>
#include "function-list.h"
#include "widget-container.h"
#include <stdlib.h>
#include <string.h>

function_list_t* function_list_new(){
	function_list_t* result = malloc(sizeof(function_list_t));
	result->controls = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);

	return result;
}
void function_list_destroy(function_list_t* function_list){
	widget_container_destroy(function_list);
	free(function_list);
}
void function_list_add(function_list_t* function_list, const char* label, const char* tip, GCallback func, gpointer data){
	GtkWidget* button = gtk_button_new_with_mnemonic(label);
	gtk_widget_set_tooltip_text(button, tip);
	g_signal_connect_swapped(button, "clicked", func, data);
	gtk_widget_show(button);
	
	gtk_box_pack_start(GTK_BOX(function_list->controls), button, TRUE, TRUE, 5);
}
